package com.mming.sso.dao;

import com.mming.sso.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface UserRepo extends JpaRepository<User, Integer> {
    User findByUsernameAndState(String username, int state);

    boolean existsUserByUsernameAndState(String username, int state);

    @Modifying
    @Query(value = "UPDATE User SET state=0 where username=?1 ")
    int deleteUserInLogical(String username);
}
